package com.tuanzi.loan.business.service.settlement.impl;

import com.tuanzi.loan.business.entity.settlement.SettlementUvRecord;
import com.tuanzi.loan.business.repository.settlement.SettlementUvRecordRepository;
import com.tuanzi.loan.business.service.settlement.SettlementUvRecordService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.core.service.CommonServiceImpl;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.settlement.SettlementUvReportRequest;
import com.tuanzi.loan.vo.response.settlement.SettlementUvReportResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author caiwanlin
 * @create 2018-03-30 14:07
 */
@Debug
@Service
@Transactional
@Retryable(value = {RetryException.class})
public class SettlementUvRecordServiceImpl extends CommonServiceImpl<SettlementUvRecord,Long> implements SettlementUvRecordService {
    @Autowired
    private SettlementUvRecordRepository settlementUvRecordRepository;
    @Override
    protected JpaRepository<SettlementUvRecord, Long> getRepository() {
        return settlementUvRecordRepository;
    }

    @Override
    public Page<SettlementUvReportResponse> list(PageSearcher<SettlementUvReportRequest> pageSearcher) {
        return settlementUvRecordRepository.list(pageSearcher.getSearchCondition(),pageSearcher.getPageable());
    }
}
